package com.pn.mapper;

import com.github.pagehelper.Page;
import com.pn.entity.ReturnGoods;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ReturnMapper {
    Page<ReturnGoods> selectReturnList(ReturnGoods returnGoods);

    //添加退货单
    @Insert("insert into return_goods values (null,#{documentNumber}," +
            "#{productId},#{returnQuantity},#{returnAmount},#{storeId},#{userId},now(),#{returnNotes},0,0)")
    int insertOutStore(ReturnGoods returnGoods);


    //修改状态为已退货
    @Update("update return_goods set is_return=1 where return_id = #{returnId}")
    int setIsReturnById(Integer returnId);
}
